.class Lcom/TwinBlade/PicturePassword/i;
.super Landroid/view/View;
.source "SourceFile"


# instance fields
.field final synthetic a:Lcom/TwinBlade/PicturePassword/e;

.field private b:Landroid/graphics/Paint;

.field private c:Landroid/graphics/Paint;

.field private final d:[I

.field private e:Lcom/TwinBlade/PicturePassword/j;

.field private f:Z

.field private g:Z


# direct methods
.method constructor <init>(Lcom/TwinBlade/PicturePassword/e;Landroid/content/Context;Lcom/TwinBlade/PicturePassword/j;I)V
    .locals 5
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 49
    iput-object p1, p0, Lcom/TwinBlade/PicturePassword/i;->a:Lcom/TwinBlade/PicturePassword/e;

    .line 50
    invoke-direct {p0, p2}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    .line 51
    iput-object p3, p0, Lcom/TwinBlade/PicturePassword/i;->e:Lcom/TwinBlade/PicturePassword/j;

    .line 52
    const/16 v0, 0xa

    new-array v0, v0, [I

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->d:[I

    .line 56
    new-instance v0, Landroid/graphics/SweepGradient;

    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->d:[I

    const/4 v2, 0x0

    invoke-direct {v0, v3, v3, v1, v2}, Landroid/graphics/SweepGradient;-><init>(FF[I[F)V

    .line 58
    new-instance v1, Landroid/graphics/Paint;

    invoke-direct {v1, v4}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->b:Landroid/graphics/Paint;

    .line 59
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->b:Landroid/graphics/Paint;

    invoke-virtual {v1, v0}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    .line 60
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->b:Landroid/graphics/Paint;

    sget-object v1, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 61
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->b:Landroid/graphics/Paint;

    const/high16 v1, 0x4200

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    .line 63
    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0, v4}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    .line 64
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v0, p4}, Landroid/graphics/Paint;->setColor(I)V

    .line 65
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    const/high16 v1, 0x40a0

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    .line 66
    return-void

    .line 52
    :array_0
    .array-data 0x4
        0x0t 0x0t 0xfft 0xfft
        0xfft 0x0t 0xfft 0xfft
        0xfft 0x0t 0x0t 0xfft
        0xfft 0xfft 0x0t 0xfft
        0x0t 0xfft 0x0t 0xfft
        0x0t 0xfft 0xfft 0xfft
        0xfft 0xfft 0xfft 0xfft
        0x80t 0x80t 0x80t 0xfft
        0x0t 0x0t 0x0t 0xfft
        0x0t 0x0t 0xfft 0xfft
    .end array-data
.end method

.method private a(IIF)I
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 123
    sub-int v0, p2, p1

    int-to-float v0, v0

    mul-float/2addr v0, p3

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    add-int/2addr v0, p1

    return v0
.end method

.method private a([IF)I
    .locals 7
    .parameter
    .parameter

    .prologue
    .line 127
    const/4 v0, 0x0

    cmpg-float v0, p2, v0

    if-gtz v0, :cond_0

    .line 128
    const/4 v0, 0x0

    aget v0, p1, v0

    .line 146
    :goto_0
    return v0

    .line 130
    :cond_0
    const/high16 v0, 0x3f80

    cmpl-float v0, p2, v0

    if-ltz v0, :cond_1

    .line 131
    array-length v0, p1

    add-int/lit8 v0, v0, -0x1

    aget v0, p1, v0

    goto :goto_0

    .line 134
    :cond_1
    array-length v0, p1

    add-int/lit8 v0, v0, -0x1

    int-to-float v0, v0

    mul-float/2addr v0, p2

    .line 135
    float-to-int v1, v0

    .line 136
    int-to-float v2, v1

    sub-float/2addr v0, v2

    .line 139
    aget v2, p1, v1

    .line 140
    add-int/lit8 v1, v1, 0x1

    aget v1, p1, v1

    .line 141
    invoke-static {v2}, Landroid/graphics/Color;->alpha(I)I

    move-result v3

    invoke-static {v1}, Landroid/graphics/Color;->alpha(I)I

    move-result v4

    invoke-direct {p0, v3, v4, v0}, Lcom/TwinBlade/PicturePassword/i;->a(IIF)I

    move-result v3

    .line 142
    invoke-static {v2}, Landroid/graphics/Color;->red(I)I

    move-result v4

    invoke-static {v1}, Landroid/graphics/Color;->red(I)I

    move-result v5

    invoke-direct {p0, v4, v5, v0}, Lcom/TwinBlade/PicturePassword/i;->a(IIF)I

    move-result v4

    .line 143
    invoke-static {v2}, Landroid/graphics/Color;->green(I)I

    move-result v5

    invoke-static {v1}, Landroid/graphics/Color;->green(I)I

    move-result v6

    invoke-direct {p0, v5, v6, v0}, Lcom/TwinBlade/PicturePassword/i;->a(IIF)I

    move-result v5

    .line 144
    invoke-static {v2}, Landroid/graphics/Color;->blue(I)I

    move-result v2

    invoke-static {v1}, Landroid/graphics/Color;->blue(I)I

    move-result v1

    invoke-direct {p0, v2, v1, v0}, Lcom/TwinBlade/PicturePassword/i;->a(IIF)I

    move-result v0

    .line 146
    invoke-static {v3, v4, v5, v0}, Landroid/graphics/Color;->argb(IIII)I

    move-result v0

    goto :goto_0
.end method


# virtual methods
.method public a(I)V
    .locals 1
    .parameter

    .prologue
    .line 109
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v0, p1}, Landroid/graphics/Paint;->setColor(I)V

    .line 110
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/i;->invalidate()V

    .line 111
    return-void
.end method

.method public b(I)V
    .locals 3
    .parameter

    .prologue
    .line 114
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getColor()I

    move-result v0

    .line 115
    invoke-static {v0}, Landroid/graphics/Color;->red(I)I

    move-result v1

    invoke-static {v0}, Landroid/graphics/Color;->green(I)I

    move-result v2

    .line 116
    invoke-static {v0}, Landroid/graphics/Color;->blue(I)I

    move-result v0

    .line 115
    invoke-static {p1, v1, v2, v0}, Landroid/graphics/Color;->argb(IIII)I

    move-result v0

    .line 117
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v1, v0}, Landroid/graphics/Paint;->setColor(I)V

    .line 118
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->a:Lcom/TwinBlade/PicturePassword/e;

    invoke-static {v1}, Lcom/TwinBlade/PicturePassword/e;->d(Lcom/TwinBlade/PicturePassword/e;)Landroid/widget/EditText;

    move-result-object v1

    iget-object v2, p0, Lcom/TwinBlade/PicturePassword/i;->a:Lcom/TwinBlade/PicturePassword/e;

    invoke-static {v2, v0}, Lcom/TwinBlade/PicturePassword/e;->a(Lcom/TwinBlade/PicturePassword/e;I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 119
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/i;->invalidate()V

    .line 120
    return-void
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 6
    .parameter
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "DrawAllocation"
        }
    .end annotation

    .prologue
    const/high16 v5, 0x4200

    const/high16 v2, 0x42c8

    const/4 v4, 0x0

    .line 74
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->b:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getStrokeWidth()F

    move-result v0

    const/high16 v1, 0x3f00

    mul-float/2addr v0, v1

    sub-float v0, v2, v0

    .line 76
    invoke-virtual {p1, v2, v2}, Landroid/graphics/Canvas;->translate(FF)V

    .line 78
    new-instance v1, Landroid/graphics/RectF;

    neg-float v2, v0

    neg-float v3, v0

    invoke-direct {v1, v2, v3, v0, v0}, Landroid/graphics/RectF;-><init>(FFFF)V

    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->b:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v0}, Landroid/graphics/Canvas;->drawOval(Landroid/graphics/RectF;Landroid/graphics/Paint;)V

    .line 79
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {p1, v4, v4, v5, v0}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V

    .line 81
    iget-boolean v0, p0, Lcom/TwinBlade/PicturePassword/i;->f:Z

    if-eqz v0, :cond_0

    .line 82
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v0}, Landroid/graphics/Paint;->getColor()I

    move-result v0

    .line 83
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 85
    iget-boolean v1, p0, Lcom/TwinBlade/PicturePassword/i;->g:Z

    if-eqz v1, :cond_1

    .line 86
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    const/16 v2, 0xff

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setAlpha(I)V

    .line 91
    :goto_0
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v1}, Landroid/graphics/Paint;->getStrokeWidth()F

    move-result v1

    add-float/2addr v1, v5

    .line 92
    iget-object v2, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    .line 90
    invoke-virtual {p1, v4, v4, v1, v2}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V

    .line 94
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Paint$Style;->FILL:Landroid/graphics/Paint$Style;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    .line 95
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v1, v0}, Landroid/graphics/Paint;->setColor(I)V

    .line 97
    :cond_0
    return-void

    .line 88
    :cond_1
    iget-object v1, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    const/16 v2, 0x80

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setAlpha(I)V

    goto :goto_0
.end method

.method protected onMeasure(II)V
    .locals 1
    .parameter
    .parameter

    .prologue
    const/16 v0, 0xc8

    .line 101
    invoke-virtual {p0, v0, v0}, Lcom/TwinBlade/PicturePassword/i;->setMeasuredDimension(II)V

    .line 102
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 9
    .parameter

    .prologue
    const/4 v2, 0x0

    const/high16 v4, 0x42c8

    const/4 v1, 0x1

    .line 153
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v0

    sub-float v3, v0, v4

    .line 154
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v0

    sub-float v4, v0, v4

    .line 155
    mul-float v0, v3, v3

    mul-float v5, v4, v4

    add-float/2addr v0, v5

    float-to-double v5, v0

    invoke-static {v5, v6}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v5

    const-wide/high16 v7, 0x4040

    cmpg-double v0, v5, v7

    if-gtz v0, :cond_1

    move v0, v1

    .line 157
    :goto_0
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v5

    packed-switch v5, :pswitch_data_0

    .line 195
    :cond_0
    :goto_1
    return v1

    :cond_1
    move v0, v2

    .line 155
    goto :goto_0

    .line 159
    :pswitch_0
    iput-boolean v0, p0, Lcom/TwinBlade/PicturePassword/i;->f:Z

    .line 160
    if-eqz v0, :cond_2

    .line 161
    iput-boolean v1, p0, Lcom/TwinBlade/PicturePassword/i;->g:Z

    .line 162
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/i;->invalidate()V

    goto :goto_1

    .line 166
    :cond_2
    :pswitch_1
    iget-boolean v2, p0, Lcom/TwinBlade/PicturePassword/i;->f:Z

    if-eqz v2, :cond_3

    .line 167
    iget-boolean v2, p0, Lcom/TwinBlade/PicturePassword/i;->g:Z

    if-eq v2, v0, :cond_0

    .line 168
    iput-boolean v0, p0, Lcom/TwinBlade/PicturePassword/i;->g:Z

    .line 169
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/i;->invalidate()V

    goto :goto_1

    .line 172
    :cond_3
    float-to-double v4, v4

    float-to-double v2, v3

    invoke-static {v4, v5, v2, v3}, Ljava/lang/Math;->atan2(DD)D

    move-result-wide v2

    double-to-float v0, v2

    .line 174
    const v2, 0x40c90fda

    div-float/2addr v0, v2

    .line 175
    const/4 v2, 0x0

    cmpg-float v2, v0, v2

    if-gez v2, :cond_4

    .line 176
    const/high16 v2, 0x3f80

    add-float/2addr v0, v2

    .line 178
    :cond_4
    iget-object v2, p0, Lcom/TwinBlade/PicturePassword/i;->d:[I

    invoke-direct {p0, v2, v0}, Lcom/TwinBlade/PicturePassword/i;->a([IF)I

    move-result v0

    .line 179
    iget-object v2, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v2, v0}, Landroid/graphics/Paint;->setColor(I)V

    .line 180
    iget-object v2, p0, Lcom/TwinBlade/PicturePassword/i;->a:Lcom/TwinBlade/PicturePassword/e;

    invoke-static {v2}, Lcom/TwinBlade/PicturePassword/e;->d(Lcom/TwinBlade/PicturePassword/e;)Landroid/widget/EditText;

    move-result-object v2

    iget-object v3, p0, Lcom/TwinBlade/PicturePassword/i;->a:Lcom/TwinBlade/PicturePassword/e;

    invoke-static {v3, v0}, Lcom/TwinBlade/PicturePassword/e;->a(Lcom/TwinBlade/PicturePassword/e;I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 181
    iget-object v2, p0, Lcom/TwinBlade/PicturePassword/i;->e:Lcom/TwinBlade/PicturePassword/j;

    invoke-interface {v2, v0}, Lcom/TwinBlade/PicturePassword/j;->b(I)V

    .line 182
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/i;->invalidate()V

    goto :goto_1

    .line 186
    :pswitch_2
    iget-boolean v3, p0, Lcom/TwinBlade/PicturePassword/i;->f:Z

    if-eqz v3, :cond_0

    .line 187
    if-eqz v0, :cond_5

    .line 188
    iget-object v0, p0, Lcom/TwinBlade/PicturePassword/i;->e:Lcom/TwinBlade/PicturePassword/j;

    iget-object v3, p0, Lcom/TwinBlade/PicturePassword/i;->c:Landroid/graphics/Paint;

    invoke-virtual {v3}, Landroid/graphics/Paint;->getColor()I

    move-result v3

    invoke-interface {v0, v3}, Lcom/TwinBlade/PicturePassword/j;->a(I)V

    .line 190
    :cond_5
    iput-boolean v2, p0, Lcom/TwinBlade/PicturePassword/i;->f:Z

    .line 191
    invoke-virtual {p0}, Lcom/TwinBlade/PicturePassword/i;->invalidate()V

    goto :goto_1

    .line 157
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method
